package ch.ti.bfh.app.loodel.domain.invitation;

import ch.ti.bfh.app.loodel.domain.learningEvent.LearningEvent;
import ch.ti.bfh.app.loodel.domain.member.Member;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;

@Entity
public class MemberLearningEventInvitation extends LearningEventInvitation {

    @ManyToOne
    @NotNull
    private Member recipient;

    public MemberLearningEventInvitation(LearningEvent learningEvent, Member sender, Member recipient) {
        super(learningEvent, sender);
        this.recipient = recipient;
    }

    protected MemberLearningEventInvitation() {
    }

    @Override
    public String getEMail() {
        return recipient.getEmail();
    }
}
